﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="showBody.aspx.cs" Inherits="cwdz.showbody" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
        .page_break
        {
            page-break-after:always;
        }
        .style1
        {
            text-align: right;
        }
    </style>
</head>
<body>
    <form id="form" runat="server">
    <div>
        <table style="width: 100%;">
            <tr>
                <td>
                    &nbsp;
                </td>
                <td style="width: 760px; text-align: center;" colspan="2">
                    好收成超市应付结算单经销明细表
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td style="width: 760px" colspan="2">
                    <table style="width: 100%;">
                        <tr>
                            <td style="width: 100px; text-align: inherit;">
                                &nbsp;
                            </td>
                            <td>
                                &nbsp;
                            </td>
                            <td style="text-align: right">
                                <asp:Label ID="showDateLabel" ForeColor="Red" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px; text-align: inherit;">
                                单&nbsp; 据&nbsp; 号：
                            </td>
                            <td>
                                <asp:Label ID="BillNoLabel" runat="server" />
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px; text-align: inherit;">
                                结 算 部门：
                            </td>
                            <td>
                                <asp:Label ID="OrgNameLabel" runat="server"></asp:Label>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px; text-align: inherit;">
                                供应商编码：
                            </td>
                            <td>
                                <asp:Label ID="SupCodeLabel" runat="server"></asp:Label>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px; text-align: inherit;">
                                供应商名称：
                            </td>
                            <td>
                                <asp:Label ID="SupNameLabel" runat="server"></asp:Label>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px; text-align: inherit;">
                                合 同 编码：
                            </td>
                            <td>
                                <asp:Label ID="HtCodeLabel" runat="server"></asp:Label>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px; text-align: inherit;">
                                合 同 名称：
                            </td>
                            <td>
                                <asp:Label ID="HtNameLabel" runat="server"></asp:Label>
                            </td>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td style="width: 760px" colspan="2">
                    <%--<asp:GridView ID="bodyGridView" runat="server" AutoGenerateColumns="False" BackColor="White"
                        BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource"
                        EnableModelValidation="True" ForeColor="Black" GridLines="Vertical" Width="860px"
                        Font-Size="Small" ShowFooter="True" 
                        onrowdatabound="bodyGridView_RowDataBound">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:BoundField DataField="YWBILLNO" HeaderText="业务单据号" 
                                SortExpression="YWBILLNO" HtmlEncode="False" />
                            <asp:BoundField DataField="REMARK" HeaderText="备注（业务类型）" 
                                SortExpression="REMARK" HtmlEncode="False">
                                <ItemStyle Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField DataField="WJTOTAL" HeaderText="无税进价金额" 
                                SortExpression="WJTOTAL" HtmlEncode="False">
                                <ItemStyle HorizontalAlign="Right" Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField DataField="JTAXTOTAL13" HeaderText="进项税额（13%）" 
                                SortExpression="JTAXTOTAL13" HtmlEncode="False">
                                <ItemStyle HorizontalAlign="Right" Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField DataField="JTAXTOTAL17" HeaderText="进项税额（17%）" 
                                SortExpression="JTAXTOTAL17" HtmlEncode="False">
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField DataField="JTAXTOTAL" HeaderText="进项税额（合计）" 
                                SortExpression="JTAXTOTAL" HtmlEncode="False">
                                <ItemStyle HorizontalAlign="Right" Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField DataField="HJTOTAL" HeaderText="含税进价金额" 
                                SortExpression="HJTOTAL" HtmlEncode="False">
                                <ItemStyle HorizontalAlign="Right" VerticalAlign="Middle" Wrap="False" />
                            </asp:BoundField>
                        </Columns>
                        <FooterStyle BackColor="#CCCC99" HorizontalAlign="Right" />
                        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" Font-Size="Small" />
                        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                        <RowStyle BackColor="#F7F7DE" />
                        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                    </asp:GridView>--%>
                    <asp:GridView ID="BodyGridView" runat="server" DataSourceID="SqlDataSource" EnableModelValidation="True"
                        AutoGenerateColumns="False" ShowFooter="True" CellPadding="4" ForeColor="#333333"
                        Width="760px" OnRowDataBound="bodyGridView_RowDataBound">
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                        <EmptyDataTemplate>系统中没有查询到您的记录。</EmptyDataTemplate>
                        <Columns>
                            <asp:BoundField DataField="YWORGNAME" HeaderText="业务组织名称" SortExpression="YWORGNAME">
                                <ItemStyle Wrap="False" />
                            </asp:BoundField>
                            <asp:BoundField DataField="BILLNO" HeaderText="BILLNO" SortExpression="BILLNO" Visible="False" />
                            <asp:BoundField DataField="YWBILLNO" HeaderText="业务单据号" SortExpression="YWBILLNO"
                                Visible="True"></asp:BoundField>
                            <asp:BoundField DataField="REMARK" HeaderText="备注" SortExpression="REMARK">
                                <ItemStyle Wrap="False" />
                            </asp:BoundField>
                            <%--<asp:BoundField DataField="JTAXRATE" HeaderText="JTAXRATE" 
                                SortExpression="JTAXRATE" >
                            <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            --%>
                            <asp:BoundField DataField="WJTOTAL" HeaderText="WJTOTAL" 
                                SortExpression="WJTOTAL" ReadOnly="True" DataFormatString="{0:N2}" 
                                Visible="False">
                            <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField DataField="HJTOTAL" HeaderText="含税进价金额" SortExpression="HJTOTAL"
                                ReadOnly="True" DataFormatString="{0:N2}">
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            <%--<asp:BoundField DataField="TaT13" HeaderText="税额（13%）" 
                                SortExpression="TaT13" ReadOnly="True" DataFormatString="{0:N2}">
                            <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField DataField="TaT17" HeaderText="税额（17%）" 
                                SortExpression="TaT17" ReadOnly="True" DataFormatString="{0:N2}">
                            <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>--%>
                        </Columns>
                        <EditRowStyle BackColor="#999999" />
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" HorizontalAlign="Right" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringOra %>"
                        ProviderName="<%$ ConnectionStrings:ConnectionStringOra.ProviderName %>" SelectCommand="SELECT YWORGNAME,BILLNO,YWBILLNO,REMARK,SUM(HJTOTAL) AS HJTOTAL FROM TACPJSJXBODY WHERE (BILLNO = ?) GROUP BY YWORGNAME,BILLNO,YWBILLNO,REMARK,JTAXRATE ORDER BY YWBILLNO">
                        <%-- 分别汇总税额 --%>
                        <%-- SelectCommand="SELECT YWORGNAME,BILLNO,YWBILLNO,REMARK,CASE JTAXRATE WHEN 17 THEN SUM(JTaxTotal) END AS TaT17,CASE JTAXRATE WHEN 13 THEN SUM(JTaxTotal) END AS TaT13, SUM(WJTOTAL) AS WJTOTAL,SUM(HJTOTAL) AS HJTOTAL FROM TACPJSJXBODY WHERE (BILLNO = ?) GROUP BY YWORGNAME,BILLNO,YWBILLNO,REMARK,JTAXRATE ORDER BY YWBILLNO" --%>
                        <SelectParameters>
                            <asp:ControlParameter ControlID="BillNoLabel" Name="BILLNO" PropertyName="Text" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <div style="text-align: right">
                        <asp:HyperLink ID="HyperLink_bodyDetail" runat="server" Target="_blank">税率明细</asp:HyperLink>
                        <%--<asp:BoundField DataField="JTAXRATE" HeaderText="JTAXRATE" 
                                SortExpression="JTAXRATE" >
                            <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            --%>
                    </div>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td style="width: 760px" colspan="2">
                    <br />
                    税率信息&nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td style="width: 760px" colspan="2">
                    <asp:GridView ID="GridView_TaxRate" runat="server" DataSourceID="sqlDataSource_TaxInfo"
                        EnableModelValidation="True" AutoGenerateColumns="False" ShowFooter="True" 
                        CellPadding="3" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" 
                        BorderWidth="1px" onrowdatabound="jTaxInfo_RowDataBound">
                        <EmptyDataTemplate>系统中没有查询到您的记录。</EmptyDataTemplate>
                        <Columns>
                            <asp:BoundField DataField="" HeaderText="序号" SortExpression="" ReadOnly="True">
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField DataField="HJTOTAL" HeaderText="含税进价金额" SortExpression="HJTOTAL" ReadOnly="True"
                                DataFormatString="{0:N2}">
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField DataField="JTAXRATE" HeaderText="进项税率（%）" SortExpression="JTAXRAT" ReadOnly="True"
                                DataFormatString="{0:N2}">
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField DataField="WJTOTAL" HeaderText="无税进价金额" SortExpression="WJTOTAL" ReadOnly="True"
                                DataFormatString="{0:N2}">
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField DataField="JTAXTOTAL" HeaderText="进项税额" SortExpression="JTAXTOTAL"
                                ReadOnly="True" DataFormatString="{0:N2}">
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                        </Columns>
                        <FooterStyle BackColor="Silver" ForeColor="#000066" HorizontalAlign="Right" />
                        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                        <RowStyle ForeColor="#000066" />
                        <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="sqlDataSource_TaxInfo" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringOra %>"
                        ProviderName="<%$ ConnectionStrings:ConnectionStringOra.ProviderName %>" SelectCommand="SELECT SUM(HJTOTAL) AS HJTOTAL, JTAXRATE, SUM(WJTOTAL) AS WJTOTAL, SUM(JTAXTOTAL) AS JTAXTOTAL FROM TACPJSJXBODY WHERE (BILLNO = ?) GROUP BY JTAXRATE">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="BillNoLabel" Name="BILLNO" PropertyName="Text" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td style="width: 760px" colspan="2">
                    <br />
                    开票信息</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td style="width: 760px" colspan="2">
                    <table bgcolor="Silver" style="width: 58%;">
                        <tr>
                            <td class="style1">
                                公司名称：</td>
                            <td>
                                天津北大荒农垦绿色食品有限公司</td>
                        </tr>
                        <tr>
                            <td class="style1">
                                税号：</td>
                            <td>
                                120107690682415</td>
                        </tr>
                        <tr>
                            <td class="style1">
                                地址：</td>
                            <td>
                                天津市滨海新区临港经济区1号1号楼385室</td>
                        </tr>
                        <tr>
                            <td class="style1">
                                电话：</td>
                            <td>
                                022-87870053</td>
                        </tr>
                        <tr>
                            <td class="style1">
                                开户行：</td>
                            <td>
                                中行格调春天支行</td>
                        </tr>
                        <tr>
                            <td class="style1">
                                帐号：</td>
                            <td>
                                279160067558</td>
                        </tr>
                        <tr>
                            <td class="style1">
                                备注：</td>
                            <td>
                                供应商确认无误后签字加盖财务章并打印</td>
                        </tr>
                    </table>


                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td style="width: 760px" colspan="2">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="4">
                    <hr class="page_break" />
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td style="width: 760px" colspan="2">
                    <br />
                    扣款明细
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                            <td style="width: 100px; text-align: inherit;">
                                供应商编码：
                            </td>
                <td style="width: 760px">
                    <asp:Label ID="Label_SupCode" runat="server" Text="Label"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                            <td style="width: 100px; text-align: inherit;">
                                供应商名称：
                            </td>
                <td style="width: 760px">
                    <asp:Label ID="Label_SupName" runat="server" Text="Label"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                            <td style="width: 100px; text-align: inherit;">
                                合 同 编码：
                            </td>
                <td style="width: 760px">
                    <asp:Label ID="Label_HtCode" runat="server" Text="Label"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                            <td style="width: 100px; text-align: inherit;">
                                合 同 名称：
                            </td>
                <td style="width: 760px">
                    <asp:Label ID="Label_HtName" runat="server" Text="Label"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td style="width: 760px" colspan="2">
                    <asp:GridView ID="tAcpJsKxGridView" runat="server" DataSourceID="SqlDataSource1"
                        EnableModelValidation="True" AutoGenerateColumns="False" CellPadding="4" ForeColor="Black"
                        GridLines="Vertical" ShowFooter="True" OnRowDataBound="tAcpJsKxGridView_RowDataBound"
                        BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px">
                        <AlternatingRowStyle BackColor="White" />
                        <EmptyDataTemplate>系统中没有查询到您的记录。</EmptyDataTemplate>
                        <Columns>
                            <%--<asp:BoundField DataField="BILLNO" HeaderText="单据号" 
                                SortExpression="BILLNO" />--%>
                            <asp:BoundField DataField="KXNAME" HeaderText="扣款项目" SortExpression="KXNAME" />
                            <asp:BoundField DataField="KXTOTAL" HeaderText="扣款金额" SortExpression="KXTOTAL" DataFormatString="{0:N2}">
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                        </Columns>
                        <FooterStyle BackColor="#CCCC99" HorizontalAlign="Right" />
                        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                        <RowStyle BackColor="#F7F7DE" />
                        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringOra %>"
                        ProviderName="<%$ ConnectionStrings:ConnectionStringOra.ProviderName %>" SelectCommand="SELECT KXNAME, SUM(KXTOTAL) AS KXTOTAL FROM TACPJSKXBODY WHERE BILLNO = ? GROUP BY KXNAME ORDER BY KXNAME">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="BillNoLabel" Name="BILLNO" PropertyName="Text" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td style="width: 760px" colspan="2">
                    <%--<asp:BoundField DataField="TaT13" HeaderText="税额（13%）" 
                                SortExpression="TaT13" ReadOnly="True" DataFormatString="{0:N2}">
                            <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField DataField="TaT17" HeaderText="税额（17%）" 
                                SortExpression="TaT17" ReadOnly="True" DataFormatString="{0:N2}">
                            <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>--%>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
